import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      redirect: '/login'
      // component:resolve => require(["../components/Login.vue"],resolve) 
    },
    {
      path:'/login',
      component:resolve => require(["../components/Login.vue"],resolve)
    },
    {
      path:'/chat',
      component:resolve => require(["../components/Chat.vue"],resolve)
    },
    {
      path:'/VideoChat/:media/:contact/:talker',
      component:resolve => require(["../components/VideoChat.vue"],resolve)
    },
    //  {
    //   path:'/AudioChat/:type/:contactnode/:talker',
    //   component:resolve => require(["../components/AudioChat.vue"],resolve)
    // },
    //  {
    //   path:'/VideoChat',
    //   component:resolve => require(["../components/VideoChat.vue"],resolve)
    // },
    {
      path:'/VideoChat',
      component:resolve => require(["../components/VideoChat.vue"],resolve)
    },
     {
      path:'/AudioChat',
      component:resolve => require(["../components/AudioChat.vue"],resolve)
    },
    {
      path:'/ChatToVideo/:command/:target',
      component:resolve => require(["../components/ChatToVideo.vue"],resolve)
    },
    {
      path:'/play',
      component:resolve => require(["../components/Play.vue"],resolve)
    },
    {
      path:'/talk',
      component:resolve => require(["../components/Talk.vue"],resolve)
    },
    {
      path:'/tmp',
      children:[{
        path:'/talk',
        component:resolve => require([],resolve)
      }]
    },
    {
        path:'*',
        component:resolve => require(["../components/404.vue"],resolve)
      }
  ]
})
